package org.fixies.utils;

import org.apache.commons.logging.LogFactory;

import static org.fixies.utils.StringUtils.concat;

/**
 * 簡易的なロガー
 *
 * @author T.Kawasaki
 */
public final class Log {

    private static final org.apache.commons.logging.Log LOGGER = LogFactory
            .getLog(Log.class);

    public static void debug(Object message, Throwable t) {
        LOGGER.debug(message, t);
    }

    public static void debug(Object... message) {
        LOGGER.debug(concat(message));
    }

    public static void error(Object message, Throwable t) {
        LOGGER.error(message, t);
    }

    public static void error(Object message) {
        LOGGER.error(message);
    }

    public static void fatal(Object message, Throwable t) {
        LOGGER.fatal(message, t);
    }

    public static void fatal(Object message) {
        LOGGER.fatal(message);
    }

    public static void info(Object message, Throwable t) {
        LOGGER.info(message, t);
    }

    public static void info(Object message) {
        LOGGER.info(message);
    }

    public static boolean isDebugEnabled() {
        return LOGGER.isDebugEnabled();
    }

    public static boolean isErrorEnabled() {
        return LOGGER.isErrorEnabled();
    }

    public static boolean isFatalEnabled() {
        return LOGGER.isFatalEnabled();
    }

    public static boolean isInfoEnabled() {
        return LOGGER.isInfoEnabled();
    }

    public static boolean isTraceEnabled() {
        return LOGGER.isTraceEnabled();
    }

    public static boolean isWarnEnabled() {
        return LOGGER.isWarnEnabled();
    }

    public static void trace(Object message, Throwable t) {
        LOGGER.trace(message, t);
    }

    public static void trace(Object message) {
        LOGGER.trace(message);
    }

    public static void warn(Object message, Throwable t) {
        LOGGER.warn(message, t);
    }

    public static void warn(Object message) {
        LOGGER.warn(message);
    }

    private Log() {
    }
}
